//
//	GetMajorListByParamRootClass.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "GetMajorListByParamRootClass.h"

NSString *const kGetMajorListByParamRootClassMajorList = @"majorList";

@interface GetMajorListByParamRootClass ()
@end
@implementation GetMajorListByParamRootClass




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(dictionary[kGetMajorListByParamRootClassMajorList] != nil && [dictionary[kGetMajorListByParamRootClassMajorList] isKindOfClass:[NSArray class]]){
		NSArray * majorListDictionaries = dictionary[kGetMajorListByParamRootClassMajorList];
		NSMutableArray * majorListItems = [NSMutableArray array];
		for(NSDictionary * majorListDictionary in majorListDictionaries){
			GetMajorListByParamMajorList * majorListItem = [[GetMajorListByParamMajorList alloc] initWithDictionary:majorListDictionary];
			[majorListItems addObject:majorListItem];
		}
		self.majorList = majorListItems;
	}
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.majorList != nil){
		NSMutableArray * dictionaryElements = [NSMutableArray array];
		for(GetMajorListByParamMajorList * majorListElement in self.majorList){
			[dictionaryElements addObject:[majorListElement toDictionary]];
		}
		dictionary[kGetMajorListByParamRootClassMajorList] = dictionaryElements;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.majorList != nil){
		[aCoder encodeObject:self.majorList forKey:kGetMajorListByParamRootClassMajorList];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.majorList = [aDecoder decodeObjectForKey:kGetMajorListByParamRootClassMajorList];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	GetMajorListByParamRootClass *copy = [GetMajorListByParamRootClass new];

	copy.majorList = [self.majorList copyWithZone:zone];

	return copy;
}
@end